package com.xuecheng.learning.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.xuecheng.api.learning.model.dto.CourseRecordDTO;
import com.xuecheng.api.learning.model.vo.ResourceUrlModel;
import com.xuecheng.common.domain.page.PageRequestParams;
import com.xuecheng.common.domain.page.PageVO;
import com.xuecheng.common.domain.response.RestResponse;
import com.xuecheng.learning.entity.CourseRecord;

/**
 * <p>
 * 选课记录 服务类
 * </p>
 *
 * @author itcast
 * @since 2021-11-21
 */
public interface CourseRecordService extends IService<CourseRecord> {


    /**
     * 根据课程和用户账号信息查询用户的学习记录
     * @param coursePubId
     * @param username
     * @return
     */
    CourseRecordDTO getRecordByCoursePubId(Long coursePubId,String username);

    /**
     * 创建学员学习记录-远程调用
     *
     * @param username
     * @param coursePubId
     * @return
     */
    RestResponse<CourseRecordDTO> createCourseRecord4S(String username, Long coursePubId);


    /**
     * 获得媒资资源地址
     * @param coursePubId
     * @param mediaId
     * @param teachplanId
     * @param username
     * @return
     */
    ResourceUrlModel getResourceUrl(Long coursePubId, Long mediaId, Long teachplanId,String username);


    Integer getCount(Long coursePubId);

    /**
     * 查询课程记录列表
     *
     * @param params
     * @return {@link PageVO}<{@link CourseRecordDTO}>
     */
    PageVO<CourseRecordDTO> queryCourseRecordList(PageRequestParams params);
}
